<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="js/jquery.js"></script>
<script>
$(document).ready(function()
		{
	  	     	
	$("#s1").click(function(){
		
		var path=$("#f1").val().split("\\");
		//alert(path);
		$("#file_name").val(path[path.length-1]);
		});
	$("#allsts").change(function() {
		var isChecked = $('.selsts').attr('checked') ? true : false;
		if (isChecked == false) {
			$(".selsts").attr('checked', true);
		} else {
			$(".selsts").attr('checked', false);
		}

	});

	$('#search').keyup(function() {
		searchTable($(this).val());
	});

	$("#example").tablesorter({
		// pass the headers argument and assing a object 
		headers : {
			// assign the secound column (we start counting zero) 
			8 : {
				// disable it by setting the property sorter to false 
				sorter : false
			}
		}
	});
	});
function searchTable(inputVal) {
	var table = $('#example');
	table.find('tr').each(function(index, row) {
		var allCells = $(row).find('td');
		if (allCells.length > 0) {
			var found = false;
			allCells.each(function(index, td) {
				var regExp = new RegExp(inputVal, 'i');
				if (regExp.test($(td).text())) {
					found = true;
					return false;
				}
			});
			if (found == true)
				$(row).show();
			else
				$(row).hide();
		}
	});
}
</script>
<s:iterator value="companylist">
<script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/calendarview.js"></script>
    <script type="text/javascript">
      window.onload = function() {
        Calendar.setup({
        	
          dateField     : 'date',
          parentElement : 'calendar'
        });
        if("%{visit_date}".match(dateField)){
        	dateField=company_name;
        }
      };
 </script>
 </s:iterator>
<link rel="stylesheet" href="css/calendarview.css" type="text/css" />

<link rel="stylesheet" type="text/css" href="css/style.css">

<style type="text/css">
#top{
	top: 0;
}
.scrollable { width:1100px; height:490px; overflow-y:auto; overflow-x:auto; clip-rect:(0px, 1100px, 490px, 0px); }


#right_icon a:LINK {
	color: white;
	text-decoration: none;
}

#right_icon a:VISITED {
	color: white;
	
}
#right_icon :HOVER {
	background-color: #CD2626;
}

#hid {
	visibility: hidden;
}
</style>

</head>
<body>
<s:actionerror />
<!-- 
	<div align="right">
		Search Entries:<input type="text" id="search" />
	</div>
 -->
<div align="left">
<table width="100%" height="25%">
<s:iterator value="doclist">
			<tr><td align="center"><font style="font-family: calibri; font-size: small; color: #515151;">Course Name&emsp;</font><font style="font-family: calibri; font-size: small;"><b><s:property value="course_name"/></b></font></td>
			<td>&emsp;|&emsp;</td><td align="center"><font style="font-family: calibri; font-size: small; color: #515151;">Course Code&emsp;</font><font style="font-family: calibri; font-size: small;"><b><s:property value="course_code"/></b></font></td>
			<td>&emsp;|&emsp;</td><td  align="center"><font style="font-family: calibri; font-size: small; color: #515151;">Lecture Duration&emsp;</font><font style="font-family: calibri; font-size: small;"><b><s:property value="lecture_duration"/></b></font></td>
			<td>&emsp;|&emsp;</td><td align="center"><font style="font-family: calibri; font-size: small; color: #515151;">Department Name&emsp;</font><font style="font-family: calibri; font-size: small;"><b><s:property value="department_name"/></b></font></td>
			<td>&emsp;|&emsp;</td><td  align="center"><font style="font-family: calibri; font-size: small; color: #515151;">Batch Name&emsp;</font><font style="font-family: calibri; font-size: small;"><b><s:property value="batch_name"/></b></font></td></tr>
	</s:iterator>	
	<tr><td colspan="14"><hr></td></tr>
</table>
</div>
<table><tr><td  width="1060" id="top" valign="top">
		</td><td width="500" align="right"><img alt="" src="images/search.png"><input type="text" id="search" size="50" />
		</td><td width="20"></td>
		</tr></table>
<table id="example" class="tablesorter" width="100%" style="border-color: gray; border-style: solid; border-width: thin;">
		<thead>
			<tr bgcolor="yellow">
				<th>Resume Name</th>
				<th>Date of Last Upload</th>
				<th>Comment</th>
				<th>DELETE</th>
			</tr>
		</thead>
		<tbody>
			
			<s:iterator value="cvlist">
				<tr>
					
					<td>
					<a href="DownloadCv.jsp?path=<s:property value="path"/>&filename=<s:property value="document_name"/>"><s:property value="document_name" /></a>
					</td>
					<td><s:property value="upload_d" /></td>
					<td><s:property value="comment" /></td>
					<td><a href="deletecv.action?attachment_id=<s:property value="attachment_id"/>">DELETE</a></td>
				</tr>
		</s:iterator>
		</tbody>
</table>

<form action="uploadcv.action" method="post" enctype="multipart/form-data" >
<input type="hidden" id="file_name" name="file_name"/>

<table  align="left">
<tr>
<td>Upload New Resume</td>
<td><input type="file" id="f1" name="attached_file"/></td>
</tr>
<tr>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" id="s1" value="Upload Resume"/></td></tr>
</table>

</form>

<table id="example" class="tablesorter" width="100%" style="border-color: gray; border-style: solid; border-width: thin;">
		<thead>
			<tr bgcolor="yellow">
				<th>Company Name</th>
				<th>Date of visit</th>
				<th>Package Offered</th>
			</tr>
		</thead>
		<tbody>
			
			<s:iterator value="companylist">
				<tr>
					<td><s:property value="company_name" /></td>
					<td><s:property value="visit_date" /></td>
					<td><s:property value="package_offered"/></td>
				</tr>
		</s:iterator>
		</tbody>
</table>
<div id="calendar">show calender</div>
</body>
</html>